<template>
  <RouterView />
</template>
<script setup lang="ts">
import wx from 'weixin-js-sdk'
import { getJsapiSignature } from '@/api'

const getJsapiSignatureFn = async () => {
  const { data } = await getJsapiSignature({
    url: encodeURIComponent(window.location.href.split('#')[0]),
  })
  wx.config({
    debug: false,
    appId: data.appId,
    timestamp: data.timestamp,
    nonceStr: data.nonceStr,
    signature: data.signature,
    jsApiList: ['scanQRCode', 'startRecord'],
  })
}
getJsapiSignatureFn()
</script>
